﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ReadFromAll.Models;
using ReadFromAll.Service;

namespace ReadFromAll
{
    internal class Program
    {
        /// <summary>
        /// 得到从txt,excel和数据库的数据并输出平均成绩，最高最低分信息
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //得到数据
            List<Student> students = StuServices.ReadToList();
            //输出数据
            StuServices.Output(students);
            Console.WriteLine();
            //得到Excel文件
            string path = "StudentInfor.xlsx";
            List<Student> studentsexcl = new List<Student>();
            Console.WriteLine("excel输出结果：");
            //得到数据
            StuServices.ReadExl(path, studentsexcl);
            //输出数据
            StuServices.Output(studentsexcl);
            Console.WriteLine();
            //得到txt文件
            string path1 = "StudentInfor.txt";
            Console.WriteLine("txt输出结果：");
            //得到数据
            List<Student> studenttxt = StuServices.ReadFromTxt(path1);
            //输出数据
            StuServices.Output(studenttxt);
            Console.ReadKey();
        }
    }
}
